package com.uniqueyi.modulewan;

import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;

import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.uniqueyi.baselib.atybase.normal.BaseAty;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends BaseAty {

    private XRecyclerView list;
    private View head;
    private List<String> listdata = new ArrayList<String>();

    @Override
    public int getLayout() {
        return R.layout.activity_main;
    }

    @Override
    public void initView() {
//        setToolbarTitle("测试");
        list=findViewById(R.id.list);
        head = LayoutInflater.from(this).inflate(R.layout.activity_association_detail_top, null, false);
        list.addHeaderView(head);
        for (int i = 0; i < 40; i++) {
            listdata.add("o" + i);
        }
        list.setLayoutManager(new LinearLayoutManager(this));
        list.setAdapter(new CommonAdapter<String>(this, R.layout.item_text, listdata) {
            @Override
            protected void convert(ViewHolder holder, String s, int position) {
                TextView textView = holder.getView(R.id.tv);
                textView.setText(s);
            }
        });
        setTranslateMode(list,"nihao","139CEA");
    }

    @Override
    public void initData() {

    }

    @Override
    public void initEvent() {

    }

    @Override
    protected void onMenuClick(MenuItem item) {

    }

    @Override
    protected boolean onMenu(MenuItem item) {
        return false;
    }

    @Override
    protected int getMenuResId() {
        return 0;
    }

    @Override
    public void onClick(View view) {

    }
}
